package net.sky.oa.test.dao.system;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import net.sky.oa.dao.system.SysOperatelogDao;
import net.sky.oa.model.SysOperatelog;
import net.sky.oa.test.BaseTestCase;

import org.junit.Test;
import org.springframework.test.annotation.Rollback;

public class SysOperatelogDaoTestCase extends BaseTestCase {

	@Resource
	private SysOperatelogDao sysOperatelogDao;

	@Test
	@Rollback(false)
	public void add() {
		SysOperatelog sysOperatelog = new SysOperatelog();
		sysOperatelog.setOperatetime(new Date());
		sysOperatelog.setType("OperatelogName");
		sysOperatelog.setDesn("1212");
		sysOperatelog.setStatus("1");
		this.sysOperatelogDao.save(sysOperatelog);
	}

	@Test
	@Rollback(false)
	public void find() {

		List<SysOperatelog> operatelogs = this.sysOperatelogDao
				.findAllOperatelog();
		for (SysOperatelog operatelog : operatelogs) {
			System.out.println("getgetOperatetime:"
					+ operatelog.getOperatetime());
		}
	}
}